<template>
	<view class="pastDetails">
		<view class="navbar">
			<u-navbar :title="navberTitle" :background="navbarBackground" back-icon-color="#fff" title-color="#fff" :border-bottom="false"></u-navbar>
		</view>
		
		<view class="topBox">
			<image class="bgImg" src="/pagesB/static/pastDetailsBg.png" mode="widthFix"></image>
			<view class="content flex_end_b">
				<view class="two">
					<image class="img" src="/pagesB/static/two.png" mode="widthFix"></image>
					<image class="avatar" src="../static/incomeBg.png" mode="aspectFill"></image>
					<view class="uname">张三</view>
					<view class="reward">
						<view class="number">2000</view>
						<view class="label">幸运豆</view>
					</view>
				</view>
				<view class="one">
					<image class="img" src="/pagesB/static/one.png" mode="widthFix"></image>
					<image class="avatar" src="../static/incomeBg.png" mode="aspectFill"></image>
					<view class="uname">张三</view>
					<view class="reward">
						<view class="number">2000</view>
						<view class="label">幸运豆</view>
					</view>
					<image class="left" src="/pagesB/static/oneLeft.png" mode="widthFix"></image>
					<image class="right" src="/pagesB/static/oneRight.png" mode="widthFix"></image>
				</view>
				<view class="three">
					<image class="img" src="/pagesB/static/three.png" mode="widthFix"></image>
					<image class="avatar" src="../static/incomeBg.png" mode="aspectFill"></image>
					<view class="uname">张三</view>
					<view class="reward">
						<view class="number">2000</view>
						<view class="label">幸运豆</view>
					</view>
				</view>
			</view>
		</view>
		
		<view class="lucky">
			<view class="title">
				<view class="text">幸运奖</view>
				<image class="titleBg" src="/pagesB/static/titleBg.png" mode="widthFix"></image>
			</view>
			<scroll-view scroll-y class="luckyList">
				<view class="item flex_space_b" v-for="(item, index) in [0, 1, 2, 3, 4, 5]" :key="index">
					<view class="info flex_conter">
						<image class="avatar" src="../static/incomeBg.png" mode="aspectFill"></image>
						<view class="uname">张三</view>
					</view>
					<view class="reward">幸运豆：10</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				scrollTop: 0,
				navberTitle: '第003期中奖记录'
			}
		},
		methods: {
			
		},
		computed:{
			navbarBackground: function () {
				if (this.scrollTop >= 40) {
					return { background: '#fe0000' }
				} else {
					return { background: 'rgba(254, 0, 0, ' + (0.02 * this.scrollTop) + ')' }
				}
			}
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
		}
	}
</script>

<style scoped lang="scss">
.pastDetails {
	.navbar {
		position: fixed;
		top: 0;
		z-index: 100;
		width: 750rpx;
	}
	
	.topBox {
		position: relative;
		height: 590rpx;
		.bgImg {
			position: absolute;
			z-index: 0;
			width: 750rpx;
		}
		.content {
			position: absolute;
			left: 24rpx;
			bottom: 24rpx;
			right: 24rpx;
			z-index: 2;
			.two {
				flex: 1;
				height: 288rpx;
				background-color: #FFFFFF;
				border-radius: 16rpx 0 0 16rpx;
				position: relative;
				.img {
					position: absolute;
					top: 0;
					left: 50%;
					width: 64rpx;
					transform: translate(-50%, -50%);
				}
				.avatar {
					width: 80rpx;
					height: 80rpx;
					border-radius: 50%;
					display: block;
					margin: 56rpx auto 0;
				}
				.uname {
					font-size: 28rpx;
					font-weight: bold;
					text-align: center;
					margin-top: 8rpx;
				}
				.reward {
					color: var(--primaryColor);
					text-align: center;
					margin-top: 12rpx;
					.number {
						font-size: 28rpx;
						font-weight: bold;
					}
					.label {
						font-size: 26rpx;
					}
				}
			}
			.one {
				width: 280rpx;
				height: 336rpx;
				background-color: #FFFFFF;
				border-radius: 16rpx 16rpx 0 0;
				position: relative;
				.img {
					position: absolute;
					top: 0;
					left: 50%;
					width: 70rpx;
					transform: translate(-50%, -50%);
				}
				.avatar {
					width: 98rpx;
					height: 98rpx;
					border-radius: 50%;
					display: block;
					margin: 72rpx auto 0;
				}
				.uname {
					font-size: 32rpx;
					font-weight: bold;
					text-align: center;
					margin-top: 8rpx;
				}
				.reward {
					color: var(--primaryColor);
					text-align: center;
					margin-top: 12rpx;
					.number {
						font-size: 28rpx;
						font-weight: bold;
					}
					.label {
						font-size: 26rpx;
					}
				}
				.left {
					position: absolute;
					top: 48rpx;
					left: -14rpx;
					width: 14rpx;
					z-index: 10;
				}
				.right {
					position: absolute;
					top: 48rpx;
					right: -14rpx;
					width: 14rpx;
					z-index: 10;
				}
			}
			.three {
				flex: 1;
				height: 288rpx;
				background-color: #FFFFFF;
				border-radius: 0 16rpx 16rpx 0;
				position: relative;
				.img {
					position: absolute;
					top: 0;
					left: 50%;
					width: 64rpx;
					transform: translate(-50%, -50%);
				}
				.avatar {
					width: 80rpx;
					height: 80rpx;
					border-radius: 50%;
					display: block;
					margin: 56rpx auto 0;
				}
				.uname {
					font-size: 28rpx;
					font-weight: bold;
					text-align: center;
					margin-top: 8rpx;
				}
				.reward {
					color: var(--primaryColor);
					text-align: center;
					margin-top: 12rpx;
					.number {
						font-size: 28rpx;
						font-weight: bold;
					}
					.label {
						font-size: 26rpx;
					}
				}
			}
		}
	}
	
	.lucky {
		height: calc(100vh - 638rpx);
		margin: 24rpx 24rpx 0;
		border-radius: 12rpx;
		background-color: #FFFFFF;
		box-shadow: 0 4rpx 8rpx rgba($color: #000000, $alpha: 0.2);
		.title {
			position: relative;
			.text {
				font-size: 32rpx;
				color: #FFFFFF;
				text-align: center;
				line-height: 70rpx;
				position: relative;
				z-index: 2;
			}
			.titleBg {
				position: absolute;
				top: 0;
				left: 50%;
				z-index: 0;
				transform: translateX(-50%);
				width: 400rpx;
			}
		}
		.luckyList {
			margin-top: 20rpx;
			height: calc(100vh - 740rpx);
			.item {
				padding: 20rpx;
				border-bottom: 1rpx solid #EEEEEE;
				.info {
					.avatar {
						width: 80rpx;
						height: 80rpx;
						border-radius: 50%;
					}
					.uname {
						font-size: 30rpx;
						margin-left: 12rpx;
					}
				}
				.reward {
					font-size: 28rpx;
					font-weight: bold;
					color: var(--primaryColor);
				}
			}
		}
	}
}
</style>
